import service from '@/utils/request'

const BASE_URL = 'api-user'

//列表
export function supplierList(data) {
    return service({
        url: `${BASE_URL}/suppliers`,
        method: 'get',
        params: data
    })
}

// 新增
export function supplierAdd(data) {
    return service({
        url: `${BASE_URL}/supplier`,
        method: 'post',
        data
    })
}

// 编辑
export function supplierEdit(data) {
    return service({
        url: `${BASE_URL}/supplier`,
        method: 'put',
        data
    })
}

// 删除
export function supplierDelete(supplierId) {
    return service({
        url: `${BASE_URL}/supplier/${supplierId}`,
        method: 'delete'
    })
}

//列表--简单
export function supplierSimpleList() {
    return service({
        url: `${BASE_URL}/suppliers/simple`,
        method: 'get'
    })
}

//获取供应商信息
export function supplierSimpleInfo(supplierId) {
    return service({
        url: `${BASE_URL}/supplier/${supplierId}`,
        method: 'get'
    })
}